
import 'package:flutter/material.dart';


//android xml io
//View
///const 关键字
///内存 和渲染 的相关优化问题
void main(){
  runApp(MaterialApp(
    theme: getTheme(),
    home: Scaffold(
      appBar: AppBar(title: const Text("这里是标题"),),
      body: const HomePage(),
      ),
    )
  );
}

//无状态组件
//有状态组件
class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const Center(
      child: Text(
        "这里是内容",
          textDirection:TextDirection.ltr
      ),
    );
  }
}







ThemeData getTheme(){
  return ThemeData(
      brightness: Brightness.dark,
      cardColor: Colors.amber,
      canvasColor: Colors.blue
  );
}